<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>dom</title>
	</head>
	<body>
		
		<div id="display">
			
		</div>
		
		
		<h1>10 <i>3<i> </h1>
		
		
		<script>
			/* let zhangsan = {
				name : "张三",
				age : 2022,
				sn : 20220217001,
			};
			
			console.log(typeof zhangsan); 
			console.log(zhangsan) */
			
			let a = 'zhangSanFeng';
			// console.log(typeof a);
			console.log(a.length); //获取长度
			console.log(a[a.length-1]); //通过下标获取某个位置的字符
			console.log(a.charAt(0));
			
			console.log(a.substring(1,4));//
			console.log(a.substr(0,5));
			console.log(a.slice(0,1));
			
			console.log(a.toUpperCase());
			console.log(a.toLowerCase());
			
			console.log(a.includes('an'));
			console.log(a.startsWith('zh'));
			console.log(a.endsWith('g'));
			
			console.log(a.indexOf('an'));
			console.log(a.lastIndexOf('an'));
			
			/* //创建对象的方法是通过new关键字来创建
			let b = new String('张无忌');
			console.log(typeof b) */
			
			let div = document.getElementById('display');
			
			div.innerHTML = a;
			div.innerHTML = a.big();
			div.innerHTML = a.small();
			div.innerHTML = a.italics();
			div.innerHTML = a.bold();
			div.innerHTML = a.fontsize('36px')
			div.innerHTML = a.fontcolor('green')
			
			
			let i = document.getElementsByTagName('i')[0];
			i.innerHTML = i.innerHTML.sup()
		</script>
		
		
	</body>
</html>
